<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>恒铸智能柜管理平台</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/resources/layui/css/layui.css"
	media="all" />
<script type="text/javascript"
	src="${pageContext.request.contextPath}/resources/layui/layui.js"></script>
</head>
<style>
.laytable-cell-1-url {
	width: 340px !important;
}
</style>
<body class="childrenBody">
	<table id="feedback" lay-filter="feedback"></table>

	<!--操作-->
	<script type="text/html" id="publish">
    <a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del">已解决</a>
</script>
	<script>
    layui.use(['form', 'layer', 'laydate', 'table', 'laytpl'], function () {
        var form = layui.form,
            layer = parent.layer === undefined ? layui.layer : top.layer,
            $ = layui.jquery,
            laydate = layui.laydate,
            laytpl = layui.laytpl,
            table = layui.table;

        var tableIns = table.render({
            elem: '#feedback',
            url: '/applet/list',
            cellMinWidth: 95,
            page: true,
            where:{sgin:2},
            height: "full-205",
            limit: 10,
            limits: [10, 15, 20, 25],
            id: "feedback",
            cols: [[
                {field: 'title', title: '标题', align: 'center'},
                {field: 'content', title: '内容', align: 'center'},
                {field: 'time', title: '提交时间', align: 'center'},
                {title: '操作', width: 90, templet: '#publish', fixed: "right", align: "center"}
            ]]
        });

        //列表操作
        table.on('tool(feedback)', function (obj) {
            var layEvent = obj.event,
                data = obj.data;


            if (layEvent === 'del') {
                // console.log(data.id)
                $.post("/applet/edit", {id:data.id,sign:3}, function (res) {
                    if (res.success) {
                        layer.msg(res.message)
                        tableIns.reload();
                    } else {
                        layer.msg(res.message)
                    }
                })

            }
        });

    })
</script>
</body>
</html>